<template>
  <a-modal
    :maskClosable="false"
    :title="title"
    centered
    width="75vw"
    :bodyStyle="{
      padding: '0 24px',
    }"
    :visible="visible"
    @cancel="handleCancel"
    cancelText="关闭"
    :okButtonProps="{ hidden: true }"
    :footer="null"
  >
    <a-card
      :bordered="false"
      :bodyStyle="{
        padding: '20px 24px 10px',
      }"
      style="width: 100%; height: 80vh; overflow-y: auto;"
    >
      <a-row type="flex" justify="center">
        <a-col :span="24">
            <erp-purchase-calibration-opinion-form ref="calibrationOpinionForm" :disabled="true" normal></erp-purchase-calibration-opinion-form>
        </a-col>
      </a-row>
    </a-card>
  </a-modal>
</template>

<script>

  import { getAction,postAction } from '@/api/manage'
  import {JeecgBpmListMixin} from '@/mixins/JeecgBpmListMixin'
  import ErpPurchaseCalibrationOpinionForm from './ErpPurchaseCalibrationOpinionForm'
  export default {
    name: 'SelectPurchaseCalibrationOpinionDetailModal',
    mixins: [JeecgBpmListMixin],
    components: {
      ErpPurchaseCalibrationOpinionForm

    },
    data () {
      return {
        title: '定标意见单详情',
        id: '',
        url: {
          queryById: "/api/erp/purchase/procurement/erpPurchaseCalibrationOpinion/queryById"
        },
        visible: false
      }
    },
    created() {
    },
    // watch: {
    //   $route(to, from) {
    //     this.loadData();
    //   },
    // },
    mounted() {
    },
    methods: {
      loadData(id) {
        getAction(this.url.queryById, { id }).then((res) => {
          if (res.success) {
            this.visible = true;
            const model = res.result
            
            this.$nextTick(() => {
              this.$refs.calibrationOpinionForm.edit(model);
            })
          }
        })
      },
      edit (record) {
        this.visible = true;
        this.$nextTick(() => {
          this.$refs.calibrationOpinionForm.edit(record);
        })
      },
      handleCancel() {
        this.visible = false
      },
      handleOk() {
        this.handleCancel()
      },
    }
  }
</script>
<style lang="less" scoped>
@import '~@assets/less/common.less';

.info {
  /deep/ .ant-card-head-title{
    flex: none;
    margin-right: 20px;
  }
  /deep/ .ant-card-extra{
    flex: 1;
    float: left;
  }
}
</style>
